pp108 : treeData Property

treeData Property


String that points to the unique identifier of an XML object which denotes the Data that is to be displayed in the tree.

Syntax

HTML

<div cordysType="wcp.library.ui.Tree" id=treeID treeSchema=schemaID treeData=sData >
...
</div>

Scripting

treeID.treeData [ =sData ]


Parameters

Parameter

Description

sData

String that points to the ID of the XML object which has the data that is to be displayed in the tree.


Remarks


The tree Data contains the data that is to be shown in tree format. Such data should strictly adhere to the definition made in schema of the tree (tree Schema). The source for tree Data can be an XML document or data obtained from a back end database. In the latter case, a busdataisland can also be used as a source for tree.

If the data is to be taken from the busdataisland directly into the tree, then the value for this property would bebusdataislandID.datawhere busdataislandID denotes the unique identifier of the busdataisland from which data is to be taken.

Example


The following example demonstrates the usage of the property.

<!-- Data that is to be displayed in tree format -->
<script type="cordys/xml" id="tdata">
  <menu>
    <description>Northwind</description>
    <Application class="Employees">
      <data>
        <id>1</id>
        <name>Nancy Davolio</name>
      </data>
    </Application>
    <Application class="Orders">
      <data>
        <id>10248</id>
        <name>Shipping</name>
      </data>
    </Application>
    <Application class="Products">
      <data>
        <id>1</id>
        <name>Aniseed Syrups</name>
      </data>
    </Application>
    <Application class="Customers">
      <data>
        <id>ERNSH</id>
        <name>Ernst Handeler</name>
      </data>
    </Application>
  </menu>
</script>
<!-- Function called on onload event of the BODY. This sets the tree schema and tree data -->
function initialize()
{
    <!-- XML ID for tree Schema is 'tschema' -->
    sampletree.treeSchema = "tschema";
    sampletree.treeData = "tdata";
}
<!-- tree definition -->
<div cordysType="wcp.library.ui.Tree" id='sampleTree'></div>

See Also


tree, treeSchema, busDataIsland